package ug.co.icom.kyazze.healthticket;

import java.util.Calendar;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;

public class MyDateDialog extends DialogFragment {

	private int year;
	private int month;
	private int day;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		setCurrentDateOnView();
		super.onCreate(savedInstanceState);
	}
	
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
    	ProfileFragment fg = (ProfileFragment) getTargetFragment();
    	return new DatePickerDialog(getActivity(), fg, year, month, day);
    }
    
 // display current date
 	public void setCurrentDateOnView() {

 		final Calendar c = Calendar.getInstance();
 		year = c.get(Calendar.YEAR);
 		month = c.get(Calendar.MONTH);
 		day = c.get(Calendar.DAY_OF_MONTH);
 	}
}
